package com.xiay.stringboot.ali;



/**
 * Created by H-209-FX-XY on 2018/5/7.
 */
public class AlipaySDK {
//    /**APPID 即创建应用后生成*/
//    private static final String APP_ID =  "300002680" ;
//    /**开发者私钥，由开发者自己生成*/
//    private static final String APP_PRIVATE_KEY = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAIjfNWUXqCNtlaBFpv4KrBTVQb4btX9Gi+UPuz7AMvwbSXmtIxV2awkz4Rg0Q3PtTkuAUpuW958u3uNxypcsCJD3o4qphgqSMVpe33bJ1bZaeL/h8WT9KNBiIxGsYQco44JbJkjrHTAI3Wt+RNhHyn+nKI9wCaeYPCY7ZipVpmL3AgMBAAECgYBn/BxWx1hIQjMQ5pnuGzGNSk9+HRMQtQoHZqI9FEwn2JtDw9QJtEOxZCa4+svcQQfguIcKCfHqj/NqHMNrglqmmJhKrut+ilUt8rqJCmvRSh8AdG7ZnqzxQYdTrrEEKgO932WqPOI98X2H+2cPzLfIOgxN7FhCDg+lVi4CBdfJ8QJBANosNf2b4f50AgAkstAKX1Hqqsb+k5L5reoF9e6eQufPXIpSrbME3cETyRMMLKX+YfhHpv66fpfg0X4JiHZIpdsCQQCgmmPNWs2nbvHY3Eo3xuYs/KJRIltgYaAd9+CCjpCTbU21afqyGkK7zibHfLADh+m5GOkOZ5IFn5Alhg1NQNgVAkBTX/PeEDVEPWcKUPv4nw4gSvKqi10wHLSGq3J5lwdweQEfZ0s0D5cDEyGTYuKpKNadwBwkWnbIacUFSnVY5phjAkAt4Ix73+F5X77kROFKl52u4if350mU+a5EgUd35AO2qXWWSgTcFZZUkaoQODULfSqtvkjs3Xcf9hm2LlnkZI6VAkEAl8+0+a6Rjz119mxJXy9JWKTbWirhja+ijyndLVEAmxTYjWTuNKbRdTYe59ekRYhmMWkiKzggP+PKjXHCHV6eRQ==";
//    /**支付宝网关（固定）*/
//    private static final String URL = "https://zmopenapi.zmxy.com.cn/sandbox.do";
//    /**编码集，支持GBK/UTF-8*/
//    private static final String CHARSET = "UTF-8";
//    /**参数返回格式，只支持json*/
//    private static final String FORMAT = "json";
//    /**支付宝公钥，由支付宝生成*/
//    private static final String ALIPAY_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC9Oa78HWtmz8p1QINVzt9RPKTbs6LdV6kaNZ2XWnoTbJZWA8eHYlRYq+uaKamHZrDX3stA2fiBSEHGekiULN2snvM+vo418qbcUoB/cd62nYxSQUeVMXVOD6PEOlrsm1vZAhPjEt2hns6F78K6CfbiUxs5b93P4gVk3YbF+5CJaQIDAQAB";
//
//    private static AlipayClient alipayClient = new DefaultAlipayClient(URL, APP_ID, APP_PRIVATE_KEY, FORMAT, CHARSET, ALIPAY_PUBLIC_KEY, "RSA2");
//
//    public static AlipayClient getAlipayClient(){
//        return alipayClient;
//    }
//
//    /**
//     * 芝麻身份认证
//     * @param transaction_id    : 商户请求的唯一标志，商户要保证其唯一性。值为32位长度的字母数字下划线组合。建议：前面几位字符是商户自定义的简称，中间可以使用一段日期，结尾可以使用一个序列
//     * @param product_code      :芝麻认证产品码，示例值为真实的产品码
//     * @param biz_code          :认证场景码，常用的场景码有：FACE：人脸认证。入参支持的认证场景码和商户签约的认证场景相关，详见芝麻认证快速接入文档,默认为FACE
//     * @param name              :"identity_type":”CERT_INFO”，是指入参类型为证件信息。芝麻认证有很多认证场景（biz_code），不同认证认证场景（biz_code）支持的入参类型不同，详细请见芝麻认证快速接入文档里面的表格
//     * @param merchant_config   :商户可选的一些设置
//     * @param ext_biz_param     :扩展业务参数，暂时没有用到，接口预留
//     * @param linked_merchant_id:芝麻平台服务商模式下的二级商户标识，如果是直连商户调用该接口，不需要设置
//     * @throws AlipayApiException
//     */
//    public static void identification(String transaction_id,String product_code,String biz_code,String name,String cardId,String merchant_config,String ext_biz_param,String linked_merchant_id) throws AlipayApiException {
//        ZhimaCustomerCertificationInitializeRequest request = new ZhimaCustomerCertificationInitializeRequest();
//
//        request.setBizContent("{" +
//                "\"transaction_id\":\""+ transaction_id +"\"," +
//                "\"product_code\":\""+ product_code +"\"," +
//                "\"biz_code\":\""+biz_code+"\"," +
//                "\"identity_param\":\"{\\\"identity_type\\\":\\\"CERT_INFO\\\",\\\"cert_type\\\":\\\"IDENTITY_CARD\\\",\\\"cert_name\\\":\\\""+name +"\\\",\\\"cert_no\\\":\\\""+cardId+"\\\"}\"," +
//                "\"merchant_config\":\"{}\"," +
//                "\"ext_biz_param\":\"{}\"," +
//                "\"linked_merchant_id\":\""+linked_merchant_id+"\"" +
//                "  }");
//
//        ZhimaCustomerCertificationInitializeResponse response = alipayClient.execute(request);
//        if (response.isSuccess()) {
//            System.out.println("调用成功");
//            System.out.println(response.toString());
//
//        } else {
//            System.out.println("调用失败");
//            System.out.println(response.getBody());
//        }
//    }
//
//    public static void identification(String transaction_id,String product_code ,String name,String cardId) throws AlipayApiException {
//        identification(transaction_id,product_code,"FACE",name,cardId,"","","");
//    }

}
